#ifndef __SIGEL_MATH_LIB_VEC2_H__
#define __SIGEL_MATH_LIB_VEC2_H__

class vec2
{
public:
	float x,y;

	vec2();
	vec2(float x,float y);
	vec2(float value);
	vec2(const vec2 &copy);

	float len() const;
	void normalize();

	float getangle() const;
	void turn(float angle);

	vec2& operator =(const vec2 &other);

	bool operator == (const vec2 &other) const;
	bool operator != (const vec2 &other) const;

	vec2 operator +() const;
	vec2 operator -() const;

	vec2 operator +(const vec2 &other) const;
	vec2 operator +(float value) const;
	vec2 operator *(const vec2 &other) const;
	vec2 operator *(float value) const;


	vec2& operator +=(const vec2 &other);
	vec2& operator +=(float value);
	vec2& operator *=(const vec2 &other);
	vec2& operator *=(float value);


	vec2 operator -(const vec2 &other) const;
	vec2 operator -(float value) const;
	vec2 operator /(const vec2 &other) const;
	vec2 operator /(float value) const;


	vec2& operator -=(const vec2 &other);
	vec2& operator -=(float value);
	vec2& operator /=(const vec2 &other);
	vec2& operator /=(float value);

	operator float*();
	operator const float*() const;

	float operator [] (int index);

	vec2 lerp(const vec2 &other, float scalar) const;
	void lerpme(const vec2 &other, float scalar);
};

#endif
